package com.landcode.land.service.consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

import com.landcode.common.config.ribbon.RibbonConfig;

@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients(basePackages = {"com.landcode.land.service.consumer.service"})
@RibbonClient(name = "service-hi", configuration = RibbonConfig.class)
public class ConsumerApplication {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        SpringApplication.run(ConsumerApplication.class, args);
    }

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
